<template>
	<view class="app">
		<view class="app-list">
			<view class="" v-for="(item, index) in motionList" :key="index" @tap='seeDec(item)'>
				<view class="app-title">
					<text>{{ item.title }}</text>
				</view>
				<view class="">
					<view class="">
						<text>审查意见</text>
						<text class="on1" v-if="item.status == 0">待审核</text>
						<text class="on1" v-if="item.status == 1">不立案</text>
						<text class="on1" v-if="item.status == 2">立案</text>
						<text class="on1" v-if="item.status == 3">来信处理</text>
						<text class="on1" v-if="item.status == 4">待回复</text>
						<text class="on1" v-if="item.status == 5">待评价</text>
						<text class="on1" v-if="item.status == 6">已评价</text>
					</view>
					<view class="">
						<text>科局</text>
						<text>{{ item.departmentName ||'暂无'}}</text>
					</view>
					<view class=""  v-if="item.status >= 5">
						<text>满意度</text>
						<text class="on2" v-if="item.appraise == 1&&item.status == 6">满意</text>
						<text class="on2" v-else-if="item.appraise == 2&&item.status == 6">基本满意</text>
						<text class="on2" v-else-if="item.appraise == 3&&item.status == 6">不满意</text>
						<text class="on2" v-else-if="item.status == 5">去评价</text>
					</view>
				</view>
			</view>
		</view>
		<view class="loading-text">{{ loadingText }}</view>
		<view class="app-fiexd" v-if='type==1'>
			<navigator hover-class="none" url="../motion/motion"><image src="https://gnzxwylz.xlygrcw.com/upload/GNZX/home/11.png" mode="widthFix"></image></navigator>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			page: 1,
			pageSize: 10,
			loadingText: '到底了......',
			motionList: [],
			type:null
		};
	},
	onShow() {
		this.motionList = []
		this.getMintionList();
		this.user = uni.getStorageSync('gnzx_users')
		this.type = this.user.frontType
	},
	onLoad() {
		
	},
	onReachBottom: function() {
		this.page++;
		console.log(this.page);
		this.getMintionList();
	},
	methods: {
		getMintionList() {
			var _this = this;
			const user = uni.getStorageSync('gnzx_users');
			const param = {
				currentPage: this.page,
				pageSize: this.pageSize,
				title: '',
				applyId: user.id
			};
			this.request({
				url: this.interfaces.getMintionList,
				data: param,
				method: 'POST',
				success: res => {
					if (res.list.length > 0) {
						this.motionList = [...this.motionList,...res.list];
						this.loadingText = '加载中......';
					} else {
						this.loadingText = '到底了......';
					}

					console.log(res.list);
					console.log(this.motionList);
				},
				fail(e) {
					uni.showToast({
						title: '获取失败'
					});
				}
			});
		},
		seeDec(data){
			uni.navigateTo({
				url:'../motion/motionDec?id=' + data.id
			})
		}
	}
};
</script>

<style lang="scss">
@import './wodetian.scss';
</style>
